<?php

class Bootstrap extends Zend_Application_Bootstrap_Bootstrap {

  protected function _initAppConfig() {
    $config = new Zend_Config($this->getOptions(), true);
    Zend_Registry::set('appConfig', $config);
    return $config;
  }
  
  protected function _initAutoload() {

    //Zend_Loader_Autoloader_Resource  - Zend_Application_Module_Autoloader
    $moduleLoader = new Zend_Application_Module_Autoloader(array(
                'namespace' => '',
                'basePath' => APPLICATION_PATH
            ));
    return $moduleLoader;
  }
	
	protected function _initRouter() {
		return new Core_Router();
	}

  protected function _initPlugins() {
    // Access plugin
    $front = Zend_Controller_Front::getInstance();
    $front->registerPlugin(new Core_ModuleControllerPlugin());
  }

  /**
   * Initialization Propel ORM
   */
  protected function _initPropel() {
    require_once 'Propel.php';
    Propel::init(APPLICATION_PATH . '/configs/db_conf.php');
    Propel::initialize();
    $config = Propel::getConfiguration(PropelConfiguration::TYPE_OBJECT);
    $config->setParameter('debugpdo.logging.details.time.enabled', true);
    $config->setParameter('debugpdo.logging.details.mem.enabled', true);
    $config->setParameter('debugpdo.logging.details.method.enabled', true);
    $con = Propel::getConnection();
    $con->useDebug(true);
  }

}

